home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.4 Applications 1997 August / SGI IRIX 6.4 Applications 1997 August.iso / dist / mmailp.idb / usr / lib / Zmail / bin / sh-versions / patch-metamail.z / patch-metamail
Encoding:
Text File  |  1997-01-22  |  2.4 KB  |  83 lines

  1. :
  2. # Copyright (c) 1991 Bell Communications Research, Inc. (Bellcore)
  3. # Permission to use, copy, modify, and distribute this material 
  4. # for any purpose and without fee is hereby granted, provided 
  5. # that the above copyright notice and this permission notice 
  6. # appear in all copies, and that the name of Bellcore not be 
  7. # used in advertising or publicity pertaining to this 
  8. # material without the specific, prior written permission 
  9. # of an authorized representative of Bellcore.  BELLCORE 
  10. # MAKES NO REPRESENTATIONS ABOUT THE ACCURACY OR SUITABILITY 
  11. # OF THIS MATERIAL FOR ANY PURPOSE.  IT IS PROVIDED "AS IS", 
  12. # WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
  13.  
  14. # Conversion from C shell to Bourne shell
  15. # by Bob Glickstein, Z-Code Software Corp.
  16. # Conversion Copyright (c) 1992 Z-Code Software Corp. (Z-Code)
  17. # Permission to use, copy, modify, and distribute this material for
  18. # any purpose and without fee is hereby granted, provided that the
  19. # above copyright notice and this permission notice appear in all
  20. # copies, and that the name of Z-Code not be used in advertising or
  21. # publicity pertaining to this material without the specific, prior
  22. # written permission of an authorized representative of Z-Code.
  23. # Z-CODE MAKES NO REPRESENTATIONS ABOUT THE ACCURACY OR SUITABILITY OF
  24. # THIS MATERIAL FOR ANY PURPOSE.  IT IS PROVIDED "AS IS", WITHOUT ANY
  25. # EXPRESS OR IMPLIED WARRANTIES.
  26.  
  27. HOSTNAME=thumper.bellcore.com
  28. DIRNAME=pub/nsb
  29. PREFIX=mm.patch.
  30.  
  31. if test -z "$2" -o ! -z "$6"
  32. then
  33.     echo "Usage: patch-metamail source-tree-root patch-number [hostname [dirname [prefix]]]"
  34.     exit 1
  35. fi
  36.  
  37. TREEROOT=$1
  38. PATCHNUMBER=$2
  39.  
  40. if test ! -z "$3"
  41. then
  42.     HOSTNAME=$3
  43. fi
  44.  
  45. if test ! -z "$4"
  46. then
  47.     DIRNAME=$4
  48. fi
  49.  
  50. if test ! -z "$5"
  51. then
  52.     PREFIX=$5
  53. fi
  54.     
  55. echo WARNING:  This program, if allowed to do so, will attempt to 
  56. echo install a PATCH file for your metamail sources which are rooted 
  57. echo in the directory $TREEROOT.
  58. echo ""
  59. echo It will use a patch file that it retrieves via anonymous ftp
  60. echo from the host $HOSTNAME, in the directory $DIRNAME, 
  61. echo with filenames starting with $PREFIX.
  62. echo ""
  63. echo-n "Do you want to install the patch in directory $TREEROOT (y/n)? [n] "
  64. read ans
  65.  
  66. case "$ans" in
  67.     [Yy]*) cd $TREEROOT
  68.            ident=`whoami`@`hostname`
  69.            echo Using anonymous ftp with password $ident
  70.            ftp -n <<!
  71. open $HOSTNAME
  72. user anonymous $ident
  73. cd $DIRNAME
  74. binary
  75. get ${PREFIX}${PATCHNUMBER}
  76. quit
  77. !
  78.            patch -p < ${PREFIX}${PATCHNUMBER} ;;
  79.     *) echo Patch not installed
  80. esac
  81.